package com.suixuan.spring.web.controller.security;


import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.suixuan.support.log.LogFactoryThread;

/**
 * 
 * @Title: UsersController.java
 * @Package com.suixuan.spring.web.controller.security
 * @Description: 登陆用户控制器
 * @author suixuan
 * @date 2010-11-15 上午08:54:06
 * @version V1.0
 */
@Controller
@RequestMapping("/security/users")
public class UsersController {
	private static LogFactoryThread logFactoryThread = LogFactoryThread.getInstance();
	/**
	 * 用户业务接口实现
	 */

	@Value("#{systemProperties.pageNum}")
	private int pageNumber;

	@Value("#{systemProperties.security_users_default_password}")
	private String defaultPassword;

	private static final String FORWARD_URL = "forward:findUsersPage";

	@RequestMapping(value = "/findUsersPage", method = [
		RequestMethod.GET,
		RequestMethod.POST,
		RequestMethod.PUT,
		RequestMethod.DELETE
	])
	public String findUsersPage(HttpServletRequest request, ModelMap modelMap) {
		String view = "security/users/user";

		println "name";
		return view;
	}

	public static void main(String[] args) {
		UsersController.metaClass.name = {s-> println "hello name ${s}"};

		def u = new UsersController();
		u.name("xyz");
		
		
		def x = u.&x;
		
		x(['x':'this is x', 'z' : 'this is z']);
		
		null?.name("zzz");
	}
	
	def x = {
		y->
		println y.x;
		println y.z;
	};
	
}
